Skip to content

Playwright Migration: topicPage#14187

Draft
MeriemMechri wants to merge 3 commits into
latestfrom
playwright-topicPage-migration
Draft

Playwright Migration: topicPage#14187
MeriemMechri wants to merge 3 commits into
latestfrom
playwright-topicPage-migration

Conversation

@MeriemMechri

@MeriemMechri MeriemMechri commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: WS-2729

Summary

A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.

Code changes

  • List key code changes that have been made.

Testing

  1. List the steps required to test this PR.

Useful Links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates topicPage end-to-end coverage to Playwright in the ws-nextjs-app, including page-content checks, pagination behaviours, and ATI analytics assertions (notably for Message Banner tracking).

Changes:

  • Added a new Playwright topicPage spec covering core content assertions, pagination navigation, script switching, and shared canonical behaviours.
  • Introduced topicPage suite definitions to parameterise runs across services/environments (canonical, ATI, ATI Lite).
  • Extended ATI analytics Playwright helpers/assertions to support the Message Banner component (view + click).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
ws-nextjs-app/playwright/specialFeatures/atiAnalytics/helpers.ts Adds MESSAGE_BANNER to the ATI component registry for request matching.
ws-nextjs-app/playwright/specialFeatures/atiAnalytics/assertions.ts Adds Playwright ATI assertions for Message Banner view and click events.
ws-nextjs-app/playwright/pageTypes/topicPage/topicPage.spec.ts New Playwright topicPage test suite (content, pagination, script switching, ATI analytics).
ws-nextjs-app/playwright/pageTypes/topicPage/suites.ts New suite definitions for canonical + ATI + ATI Lite topicPage runs.

Comment on lines +354 to +367
const messageBannerTitle = topicPageState.messageBanner?.title;
const messageBannerTestId = messageBannerTitle
? `message-banner-${idSanitiser(messageBannerTitle)}`
: undefined;
const messageBannerLinkLocator = messageBannerTestId
? page
.locator(`[data-testid="${messageBannerTestId}"]`)
.locator('a')
.first()
: page
.locator('[data-testid^="message-banner-"]')
.first()
.locator('a')
.first();
Comment on lines +188 to +192
const shouldTestTwoTierNav = (suite: TopicPageTestSuite) => {
const serviceName =
getServiceConfig(suite.service, suite.variant)?.name || suite.service;
return twoTierNavServices[appEnvFromProcess]?.includes(serviceName) ?? false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants